package com.anjiplus.template.gaea.business.work.point.service.impl;

import com.anjiplus.template.gaea.business.work.point.dao.PointDao;
import com.anjiplus.template.gaea.business.work.point.entity.Point;
import com.anjiplus.template.gaea.business.work.point.service.PointService;
import com.anjiplus.template.gaea.business.work.station.entity.Station;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 参数点service实现类
 *
 * @author yxm
 */
@Service
public class PointServiceImpl implements PointService {

    private PointDao pointDao;

    PointServiceImpl(PointDao pointDao) {
        this.pointDao = pointDao;
    }

    /**
     * 查询全部参数点列表
     *
     * @return
     */
    @Override
    public List<Point> listAll() {
        return pointDao.listAll();
    }

    /**
     * 查询指定站点和参数点名称的参数点列表
     *
     * @param id   站点id
     * @param name 参数点name
     * @return
     */
    @Override
    public List<Point> listByStationIdAndPointName(String id, String name) {
        return pointDao.listByStationIdAndPointName(id, name);
    }

    /**
     * 查询指定站点的参数点列表
     *
     * @param id 站点id
     * @return
     */
    @Override
    public List<Point> listByStationId(String id) {
        return pointDao.listByStationId(id);
    }

    /**
     * 根据参数点名称模糊查询参数点列表
     *
     * @param name
     * @return
     */
    @Override
    public List<Point> listByPointName(String name) {
        return pointDao.listByPointName(name);
    }

    /**
     * 添加参数点
     *
     * @param point
     * @return
     */
    @Override
    public int add(Point point) {
        return pointDao.add(point);
    }

    /**
     * 移除参数点
     *
     * @param id
     * @return
     */
    @Override
    public int remove(String id) {
        return pointDao.remove(id);
    }

    /**
     * 修改参数点
     *
     * @param point
     * @return
     */
    @Override
    public int update(Point point) {
        return pointDao.update(point);
    }

}
